package com.springboot.springbootredis.model;


import com.springboot.springbootredis.valid.DateTimeFormat;
import com.springboot.springbootredis.valid.Group;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @Author: TongRui乀
 * @Date: 2019/1/15 9:28
 * @description：
 */
@Data
public class User {

    @NotNull(message = "id 不能为空", groups = Group.Default.class)
    private String id;

    @NotNull(message = "名称不能为空", groups = Group.Default.class)
    private String name;

    @Min(value = 1, message = "最小不能小于1", groups = Group.Default.class)
    @NotNull(message = "年龄不能为空", groups = Group.Default.class)
    private int age;

    @NotNull(message = "地址不能为空", groups = Group.Default.class)
    private String address;

    @DateTimeFormat(format = "yyyy-MM-dd HH:mm:ss", groups = Group.Default.class)
    private String createTime;
}
